package com.xxxx.web.dto;

import com.xxxx.web.entity.*;
import com.xxxx.web.enums.*;
import com.xxxx.web.tools.dto.BaseDto;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;

/**
 * 入库明细表类
 */
@Data
public class StockInDetDto extends BaseDto {


    /**
     * 库位
     */
    @JsonProperty("WarehouseBinId")
    private Integer WarehouseBinId;


    /**
     * 入库单
     */
    @JsonProperty("StockInId")
    private Integer StockInId;


    /**
     * 仓库
     */
    @JsonProperty("WarehouseId")
    private Integer WarehouseId;


    /**
     * 数量
     */
    @JsonProperty("Qty")
    private Double Qty;


    /**
     * 商品
     */
    @JsonProperty("CargoId")
    private Integer CargoId;

    @JsonProperty("CargoDto")
    private CargoDto CargoDto;

    @JsonProperty("WarehouseBinDto")
    private WarehouseBinDto WarehouseBinDto;

    @JsonProperty("StockInDto")
    private StockInDto StockInDto;

    @JsonProperty("WarehouseDto")
    private WarehouseDto WarehouseDto;

    /**
     * 把入库明细表传输模型转换成入库明细表实体
     */
    public StockInDet MapToEntity() throws InvocationTargetException, IllegalAccessException {
        StockInDet StockInDet = new StockInDet();

        BeanUtils.copyProperties(StockInDet, this);

        return StockInDet;
    }

}
